package com.capgemini.business.service.impl;

import com.capgemini.business.mapper.ProjectTeamMembersMapper;
import com.capgemini.business.mapper.dataobject.ProjectTeamMembers;
import com.capgemini.business.service.ProjectTeamMembersService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class ProjectTeamMembersServiceImpl implements ProjectTeamMembersService {

    private final ProjectTeamMembersMapper projectTeamMembersMapper;

    @Override
    public List<ProjectTeamMembers> list() {
        return projectTeamMembersMapper.selectList(null);
    }

    @Override
    public void save(ProjectTeamMembers projectTeamMembers) {
        projectTeamMembersMapper.insert(projectTeamMembers);
    }

    @Override
    public void update(ProjectTeamMembers projectTeamMembers) {
        projectTeamMembersMapper.updateById(projectTeamMembers);
    }

    @Override
    public void delete(Integer id) {
        projectTeamMembersMapper.deleteById(id);
    }

    @Override
    public ProjectTeamMembers findById(Integer id) {
        return projectTeamMembersMapper.selectById(id);
    }
}
